package com.kun.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * 
 * 
 * @author kun_er
 * @email 2661038743@qq.com
 * @date 2022-05-02 16:08:08
 */

@TableName("order_detailed")
public class OrderDetailedEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 详情id
	 */
	@TableId(value="id",type= IdType.AUTO)
	@Getter @Setter
	private Integer id;
	/**
	 * 产品名称
	 */

	@Getter @Setter
	private String pName;
	/**
	 * 单位规格
	 */
	@Getter @Setter
	private String pUnitName;
	/**
	 * 订单数量
	 */
	@Getter @Setter
	@TableField("num")
	private Integer num;
	/**
	 * 产品单价
	 */
	@Getter @Setter
	private BigDecimal pUnitPrice;
	/**
	 * 产品总价
	 */

	private BigDecimal pTotalPrice;

	public BigDecimal getpTotalPrice() {
		BigDecimal itemPrice = this.getPUnitPrice().multiply(new BigDecimal(this.getNum().toString()));
		return itemPrice;
	}

	public void setpTotalPrice(BigDecimal pTotalPrice) {
		this.pTotalPrice = pTotalPrice;
	}

	/**
	 * 订单id
	 */
	@Getter @Setter
	private Integer parentid;
	/**
	 * 分类id
	 */
	@Getter @Setter
	private Integer cid;

	/**
	 * 产品id
	 */
	@Getter @Setter
	private Integer sid;

}
